#!/bin/bash

PROGRAM="1_xPaciae40.x"
LOGFILE="gdb.log"

cat > gdb_commands.txt <<EOF
set pagination off
set logging file $LOGFILE
set logging on
run
backtrace full
set logging off
quit
EOF

gdb -q -batch -x gdb_commands.txt --args $PROGRAM
